﻿<template>
    <div v-if="isVisible" class="modal">
      <div class="modal-content">
        <div class="title">提醒</div>
        <div class="sure">确定要清除最近浏览吗？</div>
        <div class="model_ft">
          <div @click="cancel" class="button">取消</div>
          <div @click="confirm" class="button">清除全部</div>
        </div>
      </div>
    </div>
  </template>
  
  <script setup>
  import { defineProps, defineEmits } from "vue";
  
  defineProps(["isVisible"]);
  
  const emit = defineEmits(["close", "confirm"]);
  
  const confirm = () => {
    emit("confirm");
  };
  
  const cancel = () => {
    emit("close");
  };
  </script>
  
  <style scoped>
  .modal {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 1; /* 置于顶层 */
  
    /* 其他样式 */
    width: 100%; /* 宽度占满屏幕 */
    height: 100%; /* 高度占满屏幕 */
    background-color: rgb(0, 0, 0); /* 背景颜色 */
    background-color: rgba(0, 0, 0, 40%); /* 黑色背景，带有透明度 */
    transition: opacity 0.5s ease;
    transform: translate(-50%, -50%);
  }
  
  /* 模态内容（前景） */
  .modal-content {
    width: 300px; /* 宽度 */
    max-width: 600px; /* 最大宽度 */
    padding: 20px;
    margin: 15% auto; /* 15% 顶部和底部空间，水平居中 */
    background-color: #fefefe;
    border: 1px solid #888;
    border-radius: 8px;
  }
  
  .model_ft {
    position: relative;
    display: flex;
    justify-content: space-around;
    margin-top: 40px;
    font-size: 18px;
  }
  
  .button {
    cursor: pointer;
  }
  
  .button:hover {
    color: #f26160;
  }
  
  .title {
    font-size: 18px;
    font-weight: 400;
    text-align: center;
  }
  
  .sure {
    --un-text-opacity: 1;
  
    margin-top: 30px;
    font-size: 15px;
    color: rgb(153 153 153 / var(--un-text-opacity));
    text-align: center;
  }
  </style>
  